import DeductionHome from "./deductionHome"
import AddDeduction from './addDeduction'
import EditDeduction from './editDeduction'

import React, { useRef, useState } from 'react'

const deductionManagement = () => {
    const [isShow, setShow] = useState(0)

    const ShowNode = () => {
        const getChildCount = (val) => {
            setShow(val)
        };

        switch (isShow) {
            case 0:
                return <DeductionHome getCount={getChildCount} ></DeductionHome>
            case 1:
                return <AddDeduction getCount={getChildCount}></AddDeduction>
            case 2:
                return <EditDeduction getCount={getChildCount}></EditDeduction>
            default:
                break;
        }
    }

    return (
        <div>
            <div>
                {<ShowNode />}
            </div>
        </div>
    );
}

export default deductionManagement;